<%= render :partial => '/admin/merchandise/sub_header'%>

<% content_for :sidemenu do %>
  <div class='admin_filters'>
    <%= form_tag admin_merchandise_properties_path, method: 'get', id: "products_search" do %>
      <%= hidden_field_tag :direction, params[:direction] %>
      <%= hidden_field_tag :sort, params[:sort] %>

      <label>Indentifing Name</label>
      <%= text_field_tag :identifing_name, params[:identifing_name] %>

      <label>Display Name</label>
      <%= text_field_tag :display_name, params[:display_name] %>
      <div style='text-align:center'>
        <%= submit_tag "Search", name: nil, class: "button red-button alert" %>
      </div>
    <% end %>
  </div>
<% end %>


<div class='admin_title_header'>
  <h3>Properties</h3>
  <%= link_to "New Property", new_admin_merchandise_property_path, class: "button", id: "new_property_button" %>
</div>

<div class="admin_properties">
  <table class='hover'>
    <thead>
    <tr class='odd'>
        <th class='column1_header'><%= sortable 'identifing_name',"ID name" %></th>
        <th><%= sortable "display_name" %></th>
        <th>Active</th>
    </tr>
    </thead>
    <% @properties.each do |property| %>
      <tr class='<%= cycle("odd", "")%>'>
        <td><%= link_to property.identifing_name, edit_admin_merchandise_property_path(property) %></td>
        <td><%= property.display_name %></td>
        <td><%= property.display_active %></td>
      </tr>
    <% end %>
  </table>

  <%= will_paginate @properties %>
</div>
